import request from '@/utils/request'

// GET /api/admin/task/list
export function taskList(params) {
  return request({
    url: '/admin/task/list',
    method: 'get',
    params
  })
}

// GET /api/admin/task/type/list
export function typeList(params) {
  return request({
    url: 'admin/task/type/list',
    method: 'get',
    params
  })
}

export function cooperList() {
  return request({
    url: 'admin/task/cooper/list',
    method: 'get',
  })
}

// POST /api/admin/task/edit
export function taskEdit(data) {
  return request({
    url: 'admin/task/edit',
    method: 'POST',
    data
  })
}

export function taskDetail(params) {
  return request({
    url: '/admin/task/detail',
    method: 'get',
    params
  })
}

export function taskDelete(params) {
  return request({
    url: '/admin/task/del',
    method: 'delete',
    params
  })
}

export function durationRecord(data) {
  return request({
    url: 'admin/task/duration/record',
    method: 'post',
    data
  })
}

export function durationOnetask(params) {
  return request({
    url: 'admin/task/duration/onetask',
    method: 'get',
    params
  })
}

export function durationApprove(params) {
  return request({
    url: 'admin/task/duration/approve',
    method: 'get',
    params
  })
}
